import * as THREE from 'three';
// import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
// const loader = new GLTFLoader();
const model  =  new THREE.Group();
model.position.set(-(1468/2),-(684/2),0);  //改变组对象顶点坐标


const geometry = new THREE.PlaneGeometry(1468, 684);
geometry.translate(1468/2,684/2,0); 
//纹理贴图加载器TextureLoader
const texLoader = new THREE.TextureLoader();
// .load()方法加载图像，返回一个纹理对象Texture
// const texture = texLoader.load('./指南针.png');
const bg_png = require("@/views/witness/pageViewBig/components/canvas/changdi.png")
const texture = texLoader.load(bg_png);
const material = new THREE.MeshLambertMaterial({
    map: texture,//map表示材质的颜色贴图属性
    transparent:true,//开启透明，这样png贴图的透明部分不显示
    // side:THREE.DoubleSide,
});

// const b1geometry = new THREE.BufferGeometry(); //创建一个几何体对象
// //类型数组创建顶点数据
// const vertices = new Float32Array([
//     0, 0, 0, //顶点1坐标
//     80, 0, 0, //顶点2坐标
//     80, 80, 0, //顶点3坐标
//     0, 0, 0, //顶点4坐标   和顶点1位置相同
//     80, 80, 0, //顶点5坐标  和顶点3位置相同
//     0, 80, 0, //顶点6坐标
// ]);
// 创建属性缓冲区对象
// const attribue = new THREE.BufferAttribute(vertices, 3); //3个为一组，表示一个顶点的xyz坐标
// // 设置几何体attributes属性的位置属性
// b1geometry.attributes.position = attribue;
// const b1material = new THREE.MeshBasicMaterial({
//     color: new THREE.Color('#ff2121'), 
//     // side: THREE.FrontSide, //默认只有正面可见
//     // side: THREE.BackSide, //设置只有背面可见
//     side: THREE.DoubleSide, //两面可见
// });
// const b1mesh= new THREE.Mesh( b1geometry, b1material );
// b1mesh.position.set(550, 330, 100);

// model.add(b1mesh)


// const meshB1 =  new THREE.Mesh(GeoB1, matB1.clone());
// meshB1.position.set(550, 330, 0);
// meshB1.name = '评标12'

// const meshB2 =  new THREE.Mesh(GeoB2,  matB1.clone())
// meshB2.position.set(430, 204, 0);
// meshB2.name = '定标1'

// const meshB3 =  new THREE.Mesh(GeoB3,  matB1.clone())
// meshB3.position.set(550, 60, 0);
// meshB3.name = 'BIM评标室'

// const meshB4 =  new THREE.Mesh(GeoB4,  matB1.clone())
// meshB4.name = '评标15'

// meshB4.position.set(70, 60, 0);

 // 人
const geometry_people = new THREE.SphereGeometry( 10, 32, 16 );
const material_people = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const mesh_people = new THREE.Mesh( geometry_people, material_people );
// model.add(mesh_people)


// 楼层
export const mesh =  new THREE.Mesh(geometry, material);


model.add(mesh)
// mesh.rotateX(-Math.PI/2);
// mesh.position.y = 2;

export default model

